package com.nsn.das.midas.model.mml.data;

import java.util.Date;
import java.util.List;
import java.util.Set;

import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.nsn.das.midas.model.component.Build;
import com.nsn.das.midas.model.component.Layer;
import com.nsn.das.midas.model.component.RevisionHistory;
import com.nsn.das.midas.model.embedded.State;
import com.nsn.das.midas.model.embedded.Version;
import com.nsn.das.midas.model.user.DASUser;
@Entity
@Table(name = "master_list_data")
public class MasterListData extends MMLData{
	private String name;// MLName
	private String purpose;//MLPurpose
	@ManyToMany(fetch=FetchType.LAZY)
	private Set<Layer> layers;//MLLayer multiple value
	@ManyToMany(fetch=FetchType.LAZY)
	private Set<Build> builds;//MLPackage,MLRelease
	private State state;//MLState
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="author_id")
	private DASUser author;//MLCreatedBy
	private Date createdAt;//MLCreated
	@Embedded
	private Version version;//MLVersion
	@OneToMany(fetch=FetchType.LAZY)
	private List<RevisionHistory> histories;//Comments,RevisionHistory
	@ManyToMany(fetch=FetchType.LAZY)
	private Set<MMLClassData> classData;
	@ManyToMany(fetch=FetchType.LAZY)
	private Set<MMLGroupData> groups;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getPurpose() {
		return purpose;
	}
	public void setPurpose(String purpose) {
		this.purpose = purpose;
	}
	public Set<Layer> getLayers() {
		return layers;
	}
	public void setLayers(Set<Layer> layers) {
		this.layers = layers;
	}
	public Set<Build> getBuilds() {
		return builds;
	}
	public void setBuilds(Set<Build> builds) {
		this.builds = builds;
	}
	public State getState() {
		return state;
	}
	public void setState(State state) {
		this.state = state;
	}
	public DASUser getAuthor() {
		return author;
	}
	public void setAuthor(DASUser author) {
		this.author = author;
	}
	public Date getCreatedAt() {
		return createdAt;
	}
	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}
	public Version getVersion() {
		return version;
	}
	public void setVersion(Version version) {
		this.version = version;
	}
	public List<RevisionHistory> getHistories() {
		return histories;
	}
	public void setHistories(List<RevisionHistory> histories) {
		this.histories = histories;
	}

	public Set<MMLGroupData> getGroupes() {
		return groups;
	}
	public void setGroupes(Set<MMLGroupData> groupes) {
		this.groups = groupes;
	}
	public Set<MMLClassData> getClassData() {
		return classData;
	}
	public void setClassData(Set<MMLClassData> classData) {
		this.classData = classData;
	}
	
}